﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="dishcart.aspx.cs" Inherits="OF.Web.admin.dishcart" %>

<%@ Register Assembly="OF.Controls" Namespace="OF.Controls" TagPrefix="cc1" %>
<%@ Register Src="~/admin/controls/head.ascx" TagPrefix="uc1" TagName="head" %>
<%@ Register Src="~/admin/controls/footer.ascx" TagPrefix="uc1" TagName="footer" %>
<%@ Register Src="~/admin/controls/menu.ascx" TagPrefix="uc1" TagName="menu" %>

<!DOCTYPE HTML>
<html>
<head>
    <title>商户资料</title>
    <meta charset="gbk">
    <link href="res/css/main.css" rel="stylesheet">
    <link href="res/css/public.css" rel="stylesheet">
        <link href="res/css/table.css" rel="stylesheet">
    <link href="res/css/flexigrid.css" rel="stylesheet">
    <script type="text/javascript" src="res/js/jquery-1.8.0.min.js"></script>
    <script src="res/js/flexigrid.pack.js" type="text/javascript"></script>
</head>
<body>
    <form id="form2" runat="server">
        <uc1:head runat="server" ID="head1" />
        <div id="page">
            <div class="clearfix" id="content">
                <div class="col-main">
                    <div class="main-wrap">
                        <table id="flexme1" class="gridScroller">
                            <thead>
                                <tr>
                                    <th width="60">编号</th>
                                    <th width="100">菜类</th>
                                    <th width="100">状态</th>
                                    <th width="100">编辑</th>
                                </tr>
                            </thead>
                            <tbody>
                                <asp:Repeater ID="RepDishCart" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td><%#Eval("id") %></td>
                                            <td><%#Eval("catname") %></td>
                                            <td><asp:Image ID="img" ImageUrl='<%#Convert.ToBoolean(Eval("state"))?"res/image/yes.gif":"res/image/no.gif"%>' runat="server"/></td>
                                            <td><a href="javascript:edit(<%#Eval("id") %>,'<%#Eval("catname") %>',<%#Eval("state")%>)">编辑</a></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </tbody>
                        </table>
                        <%--分页--%>
                        <cc1:OFPager ID="OFPager" runat="server" OnPageChanged="Pager_PageChanged" PageSize="15" class="pagination" />
                        <asp:Label ID="Nodata" runat="server" Text="暂无数据" CssClass="nodata"></asp:Label>
                    </div>
                    <br />
                     <div class="main-wrap">
                           <div class="division">
                            <table>
                                <tbody>
                                <tr>
                                    <td>类目名称</td>
                                    <td>
                                        <cc1:OFTextBox ID="txtCartName" runat="server" CanBeNull="必填" MaxLength="20" CssClass="ipt ipt-150"></cc1:OFTextBox>

                                    </td>
                                </tr>
                                <tr>
                                    <td>状态：</td>
                                    <td>
                                        <asp:RadioButtonList ID="ddlState" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                            <asp:ListItem Value="1" Selected="True">使用中</asp:ListItem>
                                            <asp:ListItem Value="0">停用</asp:ListItem>
                                        </asp:RadioButtonList></td>
                                </tr>
                                <tr>

                                    <td>
                                        <asp:HiddenField ID="hfid" runat="server" />
                                        <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="rz-deep-btn" OnClick="btnSave_Click" /></td>
                                </tr>
                                    </tbody>
                            </table>
                        </div>
                     </div>
                </div>
                <uc1:menu runat="server" ID="menu" />
            </div>
        </div>

        <uc1:footer runat="server" ID="footer" />
        <script type="text/javascript">
            $(document).ready(function ($) {
                $('#flexme1').flexigrid();
            });
            function edit(id, name, state) {
                $("#hfid").val(id);
                $("#txtCartName").val(name);
                $("#ddlState").val(state);
            }
        </script>
    </form>

</body>
</html>
